package com.pml.listener;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

public class SessionAttributeListener implements HttpSessionAttributeListener{
    @Override
    public void attributeAdded(HttpSessionBindingEvent httpSessionBindingEvent) {
        System.out.println("增加Session"+httpSessionBindingEvent.getSession().getId()+" "
                +httpSessionBindingEvent.getName()+"="+httpSessionBindingEvent.getValue());
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent httpSessionBindingEvent) {
        System.out.println("删除Session"+httpSessionBindingEvent.getSession().getId()+" "
                +httpSessionBindingEvent.getName()+"="+httpSessionBindingEvent.getValue());
    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent httpSessionBindingEvent) {
        System.out.println("替换Session"+httpSessionBindingEvent.getSession().getId()+" "
                +httpSessionBindingEvent.getName()+"="+httpSessionBindingEvent.getValue());
    }
}
